<?php

namespace mpend\modules\home\models;

use Yii;
use common\logics\PositionLogic;
use common\models\navigation\Navigation;

/**
 * 首页默认面板信息
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DashboardLogic extends \common\logics\DashboardLogic {

    /**
     * @var array 轮播图
     */
    public $broadcast = [];

    /**
     * @var Navigation|null
     */
    public $navigation;

    /**
     * 顶部轮播图
     * @inheritdoc
     */
    protected function setBroadcast() {
        return PositionLogic::findByName('broadcast.home');
    }

    /**
     * Set top pages
     * @inheritdoc
     */
    protected function setNavigation() {
        return Navigation::findByName('home')->one();
    }

}
